KindEditor.plugin('remoteImage',function(K){
	var self = this, name = 'remoteImage',
	lang = self.lang(name + '.'),
	images= K.undef(self.images, []);
	self.plugin.imagesHtml=function(options){
		var images_html=K('<div></div>');
		K.each(images,function(i){
			var item_div=K('<div class="ke-inline-block ke-photo" style="cursor: pointer;" title="20130605151826_52.jpg (582KB, 2013-06-05 15:18:26)"></div>')
			item_div.append('<img src="'+this+'" alt="" width="80" height="80">');
			item_div.bind('click',function(e){
				alert(K(this));
			});
			images_html.append(item_div);
		});
		return images_html.html();
	};
	self.clickToolbar(name, function() {
		var lang = self.lang(name + '.'),
			html = ['<div style="padding:10px 20px;">',
			        self.plugin.imagesHtml({images:images}),
				'</div>'].join(''),
			dialog = self.createDialog({
				name : name,
				width : 450,
				title : self.lang(name),
				body : html,
				yesBtn : {
					name : self.lang('yes'),
					click : function(e) {
							alert(input.length);
							self.insertHtml("<img src=''>").hideDialog().focus();
							
						}
				}
			}),
			input = K('input[name="image"]', dialog.div);
		});
});